#include <stdio.h>
#include <stdlib.h>

#include "ExtremeC_examples_chapter7_1_car.h"

int main(int argc, char** argv) {
    //为 car 对象分配内存
    struct car_t* car = car_new();
    //构造 car 对象
    car_ctor(car);

    printf("Engine temperature before starting the car: %f\n", car_get_engine_temperature(car));
    car_start(car);
    printf("Engine temperature after starting the car: %f\n", car_get_engine_temperature(car));
    car_stop(car);
    printf("Engine temperature after stopping the car: %f\n", car_get_engine_temperature(car));

    //析构 car 对象
    car_dtor(car);

    //释放 car 对象分配的内存
    free(car);
    return 0;
}